package a01;

/**
 * @author Sven Eric Panitz
 */
import java.util.*;

class RemoveAnimation extends AnimationPanel {

    private static final long serialVersionUID = 1L;

    public void doChecks() {
	List<GameObject> toRemove = new LinkedList<GameObject>();
	for (GameObject g1 : gos)
	    for (GameObject g2 : gos)
		if (g1 != g2 && g1.touches(g2)) {
		    if (g1.isLargerThan(g2))
			toRemove.add(g2);
		    else
			toRemove.add(g1);
		}
	gos.removeAll(toRemove);
    }
}
